package com.gx.smart.building.ui.maintain.fragment

import com.gx.smart.base.BaseMVVMRefreshFragmentV2
import com.gx.smart.building.ui.maintain.viewmodel.MaintainViewModel
import com.scwang.smartrefresh.layout.api.RefreshLayout

/**
 *@author: xiaosy
 *时间: 2022/3/23
 *@Description: java类作用描述
 *@Version: 1.0
 **/
abstract class CommonFragment : BaseMVVMRefreshFragmentV2<MaintainViewModel>(){
    open var keyword: String? = null
    override fun getToolbarTitle(): String? {
        return ""
    }

    override fun enableToolbar(): Boolean {
        return false
    }


    override fun onBindViewModel(): Class<MaintainViewModel> = MaintainViewModel::class.java

    override fun onRefresh(refreshlayout: RefreshLayout) {
        super.onRefresh(refreshlayout)
        doAction()
    }

    override fun onLoadMore(refreshLayout: RefreshLayout) {
        super.onLoadMore(refreshLayout)
        doAction()
    }


    open fun doAction() {

    }

    open fun search(keyword: String?) {
        this.keyword = keyword
    }
}